package cn.lizemin.decorator.version1;


import cn.lizemin.decorator.version1.Drink.Coffee;
import cn.lizemin.decorator.version1.Drink.Drink;
import cn.lizemin.decorator.version1.Drink.NaiXue;

/**
 * @author lzm
 * @version 1.0
 * @description: TODO
 * @date 2022/4/14 11:29
 */
public class Client {
    /**
     * 程序的入口
     * 缺陷：所有的饮料都只能加糖，万一有的人还想加汤料，加辣椒粉呢，这个版本的装饰者模型就不够用了，
     * 因此还需要对装饰类（增强类）也要做个扩展
     */
    public static void main(String[] args) {
        System.out.println("--------------------对奈雪加糖-----------------------");
        System.out.println("---------加糖前-----------");
        Drink naiXue = new NaiXue();
        System.out.println(naiXue.getDescription());

        System.out.println("---------加糖后-----------");
        naiXue = new Sugar(naiXue);
        System.out.println(naiXue.getDescription());

        System.out.println("--------------------对咖啡加糖-----------------------");
        System.out.println("---------加糖前-----------");
        Drink coffee = new Coffee();
        System.out.println(coffee.getDescription());
        System.out.println("---------加糖后-----------");
        coffee = new Sugar(coffee);
        coffee = new Sugar(coffee);
        System.out.println(coffee.getDescription());



    }
}
